<template>
    <div class="">
        <div class="pr10">
            <div class="analyItem">
                <p class="analyItemTit tx-center">状态</p>
                <div class="analyItemCon">
                    <div class='lh28'>
                        <span class="cBlue pointer" @click="chooseLevel(currentLevel,1)">{{currentLevel}}级 </span> 升
                        <span style="color:#e033ff" class="pointer" @click="chooseLevel(nextLevel,2)">{{nextLevel&lt;=12?nextLevel:'max'}}级</span>
                        <!-- <p v-if="standoContentNext">我是{{nextLevel}}级标准</p> -->
                        <!-- <span class="cBlue pointer" @click="standoContent = !standoContent, standoContentNext = false">{{this.leftInfo.user_level}}级 </span> 升
                        <span style="color:#e033ff" class="pointer" @click="standoContentNext = !standoContentNext, standoContent = false">{{Number(this.leftInfo.user_level)===12?this.leftInfo.user_level:(this.leftInfo.user_level+1)}}级</span>
                        <p v-if="standoContent">我是{{this.leftInfo.user_level}}级标准</p>
                        <p v-if="standoContentNext">我是{{Number(this.leftInfo.user_level)===12?this.leftInfo.user_level:(this.leftInfo.user_level+1)}}级标准</p> -->
                    </div>
                    <div class='lh28'>
                        <span class=" pr8">押金</span>
                        <span class="cLightGray">{{leDeposit}}</span>
                    </div>
                    <div class='lh28'>
                        <span class="fl pr8">级别优势</span>
                        <div class="col-md-4">
                            <span class="cLightGray pr8">单项额</span>
                            <p class="cGreen">{{levelInfo.leReceiptNum/10000}}万</p>
                        </div>
                        <div class="col-md-3">
                            <span class="cLightGray pr8">总项额</span>
                            <p class="cGreen">{{levelInfo.leReceiptMoney/10000}}万</p>
                        </div>
                        <div class="col-md-3">
                            <span class="cLightGray pr8"> 接单个数</span>
                            <p class="cGreen">{{levelInfo.leReceiptAmount}}个</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="thinScroll pr10" v-scrollHeight="100">
            <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                <p class="analyItemTit tx-center">押金</p>
                <div class="analyItemCon">
                    <p class="col-md-3">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{this.vailidateInfo===true?0:(upgradeInfo.leDeposit/10000).toFixed(2)}}万</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">完成</span>
                        <span>{{this.vailidateInfo===true?0:(upgradeInfo.depositCash/10000).toFixed(2)}}万</span>
                    </p>
                    <!-- <p class="col-md-4">
                        <span class="cLightGray pr8">差额1</span>
                        <span>{{upgradeInfo?((upgradeInfo.leDeposit-upgradeInfo.depositCash)/10000).toFixed(2):0}}万</span>
                    </p> -->
                    <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span class='cGreen' v-if="upgradeInfo.depositCash-upgradeInfo.leDeposit>=0">{{upgradeInfo===undefined?0:((upgradeInfo.depositCash-upgradeInfo.leDeposit)/10000).toFixed(2)}}万</span>
                        <span class='cRed' v-else>{{this.vailidateInfo===true?0:((upgradeInfo.depositCash-upgradeInfo.leDeposit)/10000).toFixed(2)}}万</span>
                    </p>
                    <span class="cGreen">{{(((this.vailidateInfo===true?0:(upgradeInfo.depositCash===undefined?0:upgradeInfo.depositCash))/(upgradeInfo.leDeposit===undefined?1:upgradeInfo.leDeposit))*100).toFixed(0)}}%</span>
                </div>
            </router-link>
            <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                <p class="analyItemTit tx-center analyShallowGreen">单限</p>
                <div class="analyItemCon">
                    <p class="col-md-3">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{this.vailidateInfo===true?0:(upgradeInfo.leReceiptNum/10000).toFixed(2)}}万</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">完成</span>
                        <span>{{this.vailidateInfo===true?0:(upgradeInfo.leReceiptNum/10000).toFixed(2)}}万</span>
                    </p>
                    <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span>0万</span>
                    </p>
                    <p class="col-md-2">
                        <span class="cGreen">{{this.vailidateInfo===true?0:'100'}}%</span>
                    </p>
                </div>
            </router-link>

            <!--   <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                <p  class="analyItemTit tx-center">竣工</p>
                    <div class="analyItemCon">
                            <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>{{upgradeInfo?(upgradeInfo.leComplete/10000).toFixed(2):0}}万</span>
                        </p>
                           <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>{{upgradeInfo?(upgradeInfo.wgMoney/10000).toFixed(2):0}}万</span>
                        </p>
                      <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}万</span>
                        </p>
           <p class="col-md-2">
                            <span class="cGreen">100%</span>
                               <span class="circlemark circlemark-lightGreen">优</span>
                        </p>

                    </div>
                </router-link> -->

            <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                <p class="analyItemTit tx-center analyShallowGreen">总限</p>
                <div class="analyItemCon">
                    <p class="col-md-3">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{this.vailidateInfo===true?0:(upgradeInfo.leReceiptMoney/10000).toFixed(2)}}万</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">完成</span>
                        <span>{{this.vailidateInfo===true?0:((upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing)/10000).toFixed(2)}}万</span>
                    </p>
                    <!-- =======================差额 -->
                    <!-- <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{(upgradeInfo?((upgradeInfo.leReceiptMoney-(upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing))/10000).toFixed(2):0)}}万</span>
                        </p> -->
                    <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span class="cGreen" v-if="upgradeInfo.contractFeeing-upgradeInfo.leReceiptMoney>=0">{{(upgradeInfo===undefined?0:(((upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing)-upgradeInfo.leReceiptMoney)/10000).toFixed(2))}}万</span>
                        <span class="cRed" v-else>{{(this.vailidateInfo===true?0:(((upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing)-upgradeInfo.leReceiptMoney)/10000).toFixed(2))}}万</span>
                    </p>
                    <!-- =======================差额 -->
                    <p class="col-md-2">
                        <span class="cGreen">{{((this.vailidateInfo===true?0:(upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing)/(upgradeInfo?upgradeInfo.leReceiptMoney:1))*100).toFixed(0)}}%</span>
                    </p>
                </div>
            </router-link>

            <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                <p class="analyItemTit tx-center">培训</p>
                <div class="analyItemCon">
                    <p class="col-md-3">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{this.vailidateInfo===true?0:upgradeInfo.leTrainingNum}}</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">完成</span>
                        <span>{{this.vailidateInfo===true?0:(upgradeInfo.sjtrainNum)}}</span>
                    </p>
                    <!-- ===============差额 -->
                    <!-- <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span>{{upgradeInfo?(upgradeInfo.leTrainingNum-upgradeInfo.sjtrainNum):0}}</span>

                    </p> -->
                    <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span class="cGreen" v-if="upgradeInfo.sjtrainNum -upgradeInfo.leTrainingNum>=0">{{upgradeInfo===undefined?0:(upgradeInfo.sjtrainNum -upgradeInfo.leTrainingNum)}}</span>
                        <span class="cRed" v-else>{{this.vailidateInfo===true?0:(upgradeInfo.sjtrainNum -upgradeInfo.leTrainingNum)}}</span>

                    </p>
                    <!-- ===============差额 -->
                    <p class="col-md-2">
                        <span class="cGreen">{{(((this.vailidateInfo===true?0:upgradeInfo.sjtrainNum)/(upgradeInfo?1:upgradeInfo.leTrainingNum))*100).toFixed(0)}}%</span>
                    </p>
                </div>
            </router-link>

            <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                <p class="analyItemTit tx-center">工人</p>
                <div class="analyItemCon">
                    <p class="col-md-3">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{this.vailidateInfo===true?0:upgradeInfo.workersStandard}}</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">完成</span>
                        <span>{{this.vailidateInfo===true?0:(upgradeInfo.cgrNum+upgradeInfo.zgrNum+upgradeInfo.ggrNum)}}</span>
                    </p>
                    <!-- <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span>{{upgradeInfo?upgradeInfo.workersStandard-((upgradeInfo.cgrNum+upgradeInfo.zgrNum+upgradeInfo.ggrNum)):0}}</span>
                    </p> -->
                    <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span class="cGreen" v-if="((upgradeInfo.cgrNum+upgradeInfo.zgrNum+upgradeInfo.ggrNum)-upgradeInfo.workersStandard)>=0">{{upgradeInfo?((upgradeInfo.cgrNum+upgradeInfo.zgrNum+upgradeInfo.ggrNum))-upgradeInfo.workersStandard:0}}</span>
                        <span class="cRed" v-else>{{this.vailidateInfo===true?0:(((upgradeInfo.cgrNum+upgradeInfo.zgrNum+upgradeInfo.ggrNum))-upgradeInfo.workersStandard)}}</span>
                    </p>
                    <p class="col-md-2">
                        <span class="cGreen">{{(((this.vailidateInfo===true?0:(upgradeInfo.cgrNum+upgradeInfo.zgrNum+upgradeInfo.ggrNum))/(upgradeInfo.workersStandard===undefined?1:upgradeInfo.workersStandard))*100).toFixed(0)}}%</span>
                    </p>
                </div>
            </router-link>

            <!--      <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                    <p class="analyItemTit tx-center" >积分</p>
                <div class="analyItemCon">
                          <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptMoney):0}}</span>
                        </p>
                           <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum):0}}</span>
                        </p>
                  <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum):0}}</span>
                        </p>
    <p class="col-md-2">
                            <span class="cGreen">100%</span>
                               <span class="circlemark circlemark-lightGreen">优</span>
                        </p>

                    </div>
                </router-link> -->

            <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                <p class="analyItemTit tx-center">成就</p>
                <div class="analyItemCon">
                    <p class="col-md-3">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{this.vailidateInfo===true?0:(upgradeInfo.leReceiptMoney/10000).toFixed(2)}}万</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">完成</span>
                        <span>{{this.vailidateInfo===true?0:(upgradeInfo.wgMoney===undefined?0:upgradeInfo.wgMoney/10000).toFixed(2)}}万</span>
                    </p>
                    <!-- <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span>{{upgradeInfo?((upgradeInfo.leReceiptMoney-(upgradeInfo.wgMoney===undefined?0:upgradeInfo.wgMoney))/10000).toFixed(2):0}}万</span>

                    </p> -->
                    <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span class="cGreen" v-if="(upgradeInfo.wgMoney-upgradeInfo.leReceiptMoney)>=0">{{upgradeInfo?(((upgradeInfo.wgMoney===undefined?0:upgradeInfo.wgMoney)-upgradeInfo.leReceiptMoney)/10000).toFixed(2):0}}万</span>
                        <span class="cRed" v-else>{{this.vailidateInfo===true?0:((((upgradeInfo.wgMoney===undefined?0:upgradeInfo.wgMoney)-upgradeInfo.leReceiptMoney)/10000).toFixed(2))}}万</span>
                    </p>
                    <p class="col-md-2">
                        <span class="cGreen">{{(((this.vailidateInfo===true?0:upgradeInfo.wgMoney)/(upgradeInfo.leReceiptMoney===undefined?1:upgradeInfo.leReceiptMoney))*100).toFixed(0)}}%</span>

                    </p>

                </div>
            </router-link>

            <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                <p class="analyItemTit tx-center">项评</p>
                <div class="analyItemCon">
                    <p class="col-md-3">
                        <span class="cLightGray pr8">标准</span>
                        <span>{{this.vailidateInfo===true?0:upgradeInfo.khpj}}</span>
                    </p>
                    <p class="col-md-3">
                        <span class="cLightGray pr8">完成</span>
                        <span>{{this.vailidateInfo===true?0:upgradeInfo.kpNum}}</span>
                    </p>
                    <p class="col-md-4">
                        <span class="cLightGray pr8">差额</span>
                        <span class="cRed">{{(this.vailidateInfo===true?0:upgradeInfo.kpNum)-(upgradeInfo?0:upgradeInfo.khpj)}}</span>

                    </p>
                    <p class="col-md-2">
                        <span class="cGreen">{{((this.vailidateInfo===true?0:upgradeInfo.kpNum/(upgradeInfo.khpj===0?upgradeInfo.khpj:1))*100).toFixed(0)}}%</span>
                        <!-- <span class="circlemark circlemark-lightRed">差</span> -->
                    </p>
                </div>
            </router-link>
            <!--     <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                    <p  class="analyItemTit tx-center">培训</p>
                    <div class="analyItemCon">
                        <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>{{upgradeInfo?(upgradeInfo.leTrainingNum):0}}</span>
                        </p>
                        <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>{{upgradeInfo?(upgradeInfo.sjtrainNum):0}}</span>
                        </p>
                    <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}</span>

                        </p>
                        <p class="col-md-2">
                            <span class="cGreen">100%</span>
                               <span class="circlemark circlemark-lightGreen">优</span>
                        </p>

                    </div>
                </router-link>
 -->
            <!--                           <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                    <p class="analyItemTit tx-center" >{{itemArray[1]}} </p>
                <div class="analyItemCon">
                        <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptMoney/10000).toFixed(2):0}}</span>
                        </p>
                          <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}</span>
                        </p>
                      <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}</span>

                        </p>
           <p class="col-md-2">
                            <span class="cGreen">100%</span>
                               <span class="circlemark circlemark-lightGreen">优</span>
                        </p>

                    </div>
                </router-link> -->
            <!--
                          <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                    <p class="analyItemTit tx-center" >材评</p>
                  <div class="analyItemCon">
                        <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptMoney/10000).toFixed(2):0}}</span>
                        </p>
                            <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}</span>
                        </p>
                           <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}</span>

                        </p>
           <p class="col-md-2">
                            <span class="cRed">10%</span>
                          <span class="circlemark circlemark-lightRed" >差</span>
                        </p>


                    </div>
                </router-link>


                          <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                    <p class="analyItemTit tx-center" >质评</p>
                    <div class="analyItemCon">
                            <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptMoney/10000).toFixed(2):0}}</span>
                        </p>
                            <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}</span>
                        </p>
                        <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}</span>

                        </p>
                   <p class="col-md-2">
                            <span class="cRed">10%</span>
                                  <span class="circlemark circlemark-lightRed" >差</span>
                        </p>

                    </div>
                </router-link>


                          <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                    <p class="analyItemTit tx-center" >现评</p>
                    <div class="analyItemCon">
                  <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptMoney/10000).toFixed(2):0}}</span>
                        </p>    <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}</span>
                        </p>
                           <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{upgradeInfo?(upgradeInfo.leReceiptNum/10000).toFixed(2):0}}</span>
                        </p>
                        <p class="col-md-2">
                            <span class="cGreen">100%</span>
                               <span class="circlemark circlemark-lightGreen">优</span>
                        </p>

                    </div>
                </router-link> -->

            <div v-if="Number(upgradeInfo.userLevel) ===4 || Number(upgradeInfo.userLevel) ===5">
                <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active" v-for="(item,index) in itemArray" :key="index">
                    <p class="analyItemTit tx-center">{{item}}</p>
                    <div class="analyItemCon">
                        <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>{{ index | filterModel(upgradeInfo,2)}}</span>

                            <!-- <span>{{ index | filterModel(upgradeInfo)}}</span> -->
                        </p>
                        <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>{{ index | filterModel(upgradeInfo,1)}}</span>
                            <!-- <span>{{ index | filterDate(upgradeInfo)}}</span> -->
                        </p>
                        <!-- <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{ index | filterModel(upgradeInfo,3)}}</span>

                        </p> -->
                        <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span v-html="$options.filters.filterModel(index,upgradeInfo,3)"></span>
                            <!-- <span class="cGreen" v-if="index | filterModel(upgradeInfo,3)>=0">{{ index | filterModel(upgradeInfo,3)}}</span> -->
                            <!-- <span class="cRed" >{{ index | filterModel(upgradeInfo,3)}}</span> -->

                        </p>
                        <!--                    <p class="col-md-2 ">
                            <span class="cRed">{{ index | filterModel(upgradeInfo,4)}}%</span>
                            <span class="circlemark circlemark-lightRed" >差</span>
                        </p> -->
                        <p class="col-md-2">
                            <span class="cGreen">{{((upgradeInfo.sjtrainNum/upgradeInfo.leTrainingNum)*100).toFixed(0)}}%</span>

                        </p>
                    </div>
                </router-link>
            </div>
            <div v-else>
                <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                    <p class="analyItemTit tx-center">产值比</p>
                    <div class="analyItemCon">
                        <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>95%</span>
                        </p>
                        <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>{{this.vailidateInfo===true?0:(((upgradeInfo.wgMoney===undefined?0:upgradeInfo.wgMoney)/(upgradeInfo.contractFee-(upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing)))*100).toFixed(2)}}%</span>
                        </p>
                        <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>{{(95-(this.vailidateInfo===true?0:(((upgradeInfo.wgMoney===undefined?0:upgradeInfo.wgMoney)/(upgradeInfo.contractFee-(upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing)))*100).toFixed(2))).toFixed(2)}}%</span>
                        </p>

                        <p class="col-md-2">
                            <span class="cGreen">{{(((this.vailidateInfo===true?0:(((upgradeInfo.wgMoney===undefined?0:upgradeInfo.wgMoney)/(upgradeInfo.contractFee-(upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing)))*100).toFixed(2))/95)*100).toFixed(0)}}%</span>

                        </p>

                    </div>
                </router-link>
                <router-link tag="div" :to="routerPath('')" class="analyItem" active-class="anItemBor-active">
                    <p class="analyItemTit tx-center">证书</p>
                    <div class="analyItemCon">
                        <p class="col-md-3">
                            <span class="cLightGray pr8">标准</span>
                            <span>0</span>
                        </p>
                        <p class="col-md-3">
                            <span class="cLightGray pr8">完成</span>
                            <span>0</span>
                        </p>
                        <p class="col-md-4">
                            <span class="cLightGray pr8">差额</span>
                            <span>0</span>

                        </p>
                        <p class="col-md-2">
                            <span class="cGreen">0%</span>

                        </p>

                    </div>
                </router-link>
            </div>
            <!-- <router-link tag="div" :to="routerPath('')"  class="analyItem" active-class="anItemBor-active">
            <p class="analyItemTit tx-center">保障</p>
            <div class="analyItemCon">
                <p class="col-md-6">
                    <span class="cLightGray pr8">五险</span>
                    <span></span>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">加点</span>
                    <span></span>
                </p>
            </div>
        </router-link>-->

        </div>
        <div class="pr10">
            <router-link tag="div" :to="routerPath('')" class="analyItem " active-class="anItemBor-active">
                <p class="analyItemTit tx-center">综合</p>
                <div class="analyItemCon">
                    <p class="col-md-10">
                        <span class="cLightGray pr8"></span>
                    </p>
                    <p class="col-md-2">
                        <span class="cGreen">{{((upgradeInfo.depositCash/upgradeInfo.leDeposit)+
                            ((upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing)/upgradeInfo.leReceiptMoney)+
                            (upgradeInfo.sjtrainNum/upgradeInfo.leTrainingNum)+
                            ((upgradeInfo.cgrNum+upgradeInfo.zgrNum+upgradeInfo.ggrNum)/upgradeInfo.workersStandard)+
                            ((upgradeInfo.wgMoney===undefined?0:upgradeInfo.wgMoney)/upgradeInfo.leReceiptMoney)+
                            (upgradeInfo.kpNum/upgradeInfo.khpj)+
                         (upgradeInfo.wgMoney===undefined?0:upgradeInfo.wgMoney)/(upgradeInfo.contractFee-(upgradeInfo.contractFeeing===undefined?0:upgradeInfo.contractFeeing)))/7*100|toFixed(2)}}%</span>
                    </p>
                </div>
            </router-link>
        </div>
    </div>
</template>
<script>
import { mapGetters } from 'vuex'
import {
    getPMUpgradeMsg,
    getAchievementMsg, findCurrentLevelDetail, findCurrentLevelInfo} from '../Resources/Api/index'
export default {
    data () {
        return {
            itemArray: ['人评', '材评', '质评', '现评'],
            pmUpgrage: {},
            pmAchievement: {},
            upgradeInfo: {},
            money: 0,
            completeNumbedr: 1,
            levelDetail: {},
            ss: 0,
            sss: 0,
            currentLevel: 0, // 当前级别
            nextLevel: 0, // 级别
            standoContentNext: false, // 标准显示
            levelMap: {}, // 接口返回级别
            leDeposit: 0, // 押金
            levelId: 0, // 高级
            leId: 0, // 低级
            levelInfo: {},
            vailidateInfo: false

        }
    },
    created () {
        this.leverment()
        // this.GetLeveInfo()
        if (this.leftInfo.user_level !== 12 || this.leftInfo.user_level !== 21) {
            this.nextLevel = Number(this.leftInfo.user_level + 1)
        } else {
            this.nextLevel = this.leftInfo.user_level
        }

        this.currentLevelDetail()
        this.chooseLevel(this.currentLevel, 1)
        this.standoContentNext = false
    },
    methods: {
    // 进入页面是有低级别
        leverment () {
            this.currentLevel = this.leftInfo.user_level
            this.leId = this.leftInfo.user_level
        },
        // 切换界别显示押金
        chooseLevel (val, index) {
            this.leDeposit = 0
            this.currentLevelDetail(val)
            this.getCurrentLevelInfo(val)
            if (index === 2) {
                this.standoContentNext = !this.standoContentNext
            } else {
                this.standoContentNext = false
            }
        },
        getCurrentLevelInfo (val) {
            let _this = this
            _this.levelInfo = {}
            findCurrentLevelInfo({
                currentLevel: val
            }).then(result => {
                _this.levelInfo = result.data.Body
            }).catch(err => {
                console.log(err)
            })
        },
        currentLevelDetail (val) {
            let _this = this
            _this.upgradeInfo = {}
            findCurrentLevelDetail({
                uid: this.leftInfo.uid
            }).then(result => {
                _this.upgradeInfo = result.data.Body
                if (_this.upgradeInfo.leComplete === undefined && _this.upgradeInfo.appCardNo === undefined && _this.upgradeInfo.uid === undefined) {
                    this.vailidateInfo = true
                } else {
                    this.vailidateInfo = false
                }
                console.log(_this.upgradeInfo)
                this.levelMap = result.data.Body.levelMap
                this.leId = result.data.Body.levelMap.leId
                if (val === this.leId) {
                    this.leDeposit = result.data.Body.levelMap.leDeposit
                    this.levelId = result.data.Body.levelMap.leId
                } else {
                    this.leDeposit = result.data.Body.levelMap.leDeposits
                    this.levelId = result.data.Body.levelMap.leIds
                }
            }).catch(err => {
                console.log(err)
            })
        },
        // 路由跳转路径拼接
        routerPath (path) {
            return this.$route.matched[1].path + '/' + path
        },
        // 直接进行路由跳转路径
        routerPush (path) {
            this.$router.push(this.$route.matched[1].path + '/' + path)
        },
        // GetLeveInfo () {
        //     let _this = this
        //     _this.upgradeInfo = {}
        //     findUpgradeInfo({
        //         uid: this.leftInfo.uid
        //     }).then(results => {
        //         this.upgradeInfo = results.data.Body
        //         if (this.upgradeInfo) {
        //             if (this.upgradeInfo.depositCash >= this.upgradeInfo.leDeposit) {
        //                 this.completeNumbedr += 1
        //             }
        //             if (this.upgradeInfo.leSecurityOpen === 1) {
        //                 this.completeNumbedr += 1
        //             }
        //             if (this.upgradeInfo.leTrainingNum > 0) {
        //                 this.completeNumbedr += 1
        //             }
        //         }
        //         this.GetAchievement()
        //     }).catch(error => {
        //         console.log(error)
        //     })
        // },
        GetPMUpgrade () {
            let _this = this
            _this.pmUpgrage = []
            getPMUpgradeMsg({
                uid: this.leftInfo.uid
            }).then(results => {
                this.pmUpgrage = results.data.Body
                if (this.pmUpgrage != null && this.upgradeInfo != null) {
                    const currentMoney = this.pmUpgrage[0].surplus_money ? (this.money + this.pmUpgrage[0].surplus_money) : this.money
                    if (this.upgradeInfo.leComplete <= currentMoney && this.upgradeInfo.leComplete > 0) {
                        this.completeNumbedr += 1
                    }
                }
            }).catch(error => {
                console.log(error)
            })
        },
        GetAchievement () {
            let _this = this
            _this.pmAchievement = []
            getAchievementMsg({
                uid: this.leftInfo.uid,
                state: 1
            }).then(results => {
                this.pmAchievement = results.data.Body
                if (this.pmAchievement) {
                    this.pmAchievement.forEach(element => {
                        this.money += element.grossProfitReceived
                    })
                }
                this.GetPMUpgrade()
            }).catch(error => {
                console.log(error)
            })
        }
    },
    computed: {
        ...mapGetters(['leftInfo'])
    },
    updated: function () {
    },
    watch: {
        leftInfo () {
            this.leverment()
            this.completeNumbedr = 1
            this.money = 0

            this.currentLevel = this.leftInfo.user_level
            this.chooseLevel(this.currentLevel, 1)
            if (this.leftInfo.user_level !== 12 || this.leftInfo.user_level !== 21) {
                this.nextLevel = Number(this.leftInfo.user_level + 1)
            } else {
                this.nextLevel = this.leftInfo.user_level
            }
            this.standoContentNext = false
        }
    },
    filters: {
        filterModel (index, data, flag) {
            let btand = ''
            let stand = ''
            let level = Number(data.userLevel)
            switch (Number(index)) {
            case 0: // 人
                stand = data ? data.rpNum : 0
                if (level === 4) {
                    btand = 10
                } else if (level === 5) {
                    btand = 18
                }
                break
            case 1: // 材
                stand = data ? data.cpNum : 0
                if (level === 4) {
                    btand = 35
                } else if (level === 5) {
                    btand = 50
                }
                break
            case 2: // 质
                stand = data ? data.zpNum : 0
                if (level === 4) {
                    btand = 70
                } else if (level === 5) {
                    btand = 110
                }
                break
            default: // 现
                stand = data ? data.xpNum : 0
                if (level === 4) {
                    btand = 9
                } else if (level === 5) {
                    btand = 16
                }
                break
            }
            if (flag === 1) {
                return stand
            } else if (flag === 2) {
                return btand
            } else if (flag === 3) {
                // return btand - stand
                if (btand - stand >= 0) {
                    return `<span class="cGreen">${btand - stand}</span>`
                } else {
                    return `<span class="cRed">${btand - stand}</span>`
                }
            } else if (flag === 4) {
                return ((stand / btand) * 100).toFixed(2)
            }
        },
        ew (index, data) {
            //      debugger
            let stand = ''
            switch (Number(index)) {
            case 0: // 人
                stand = data ? data.rpNum : 0
                break
            case 1: // 材
                stand = data ? data.cpNum : 0
                break
            case 2: // 质
                stand = data ? data.zpNum : 0
                break
            default: // 现
                stand = data ? data.xpNum : 0
                break
            }
            return stand
        }
    }
}
</script>
